<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title>管理员后台管理中心</title>
		<meta name="keywords" content="管理员后台管理中心" />
		<meta name="description" content="管理员后台管理中心" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />

		<link href="<?php echo base_url('assets/css/bootstrap.min.css')?>" rel="stylesheet" />
		<link rel="stylesheet" href="<?php echo base_url('assets/css/font-awesome.min.css')?>" />

		<link rel="stylesheet" href="<?php echo base_url('assets/css/ace.min.css')?>" />
		<link rel="stylesheet" href="<?php echo base_url('assets/css/ace-rtl.min.css') ?>" />
	</head>

	<body class="login-layout">
		<div class="main-container">
			<div class="main-content">
				<div class="row">
					<div class="col-sm-10 col-sm-offset-1">
						<div class="login-container">
							<div class="center">
								<h1>
									<span class="red">管理员后台</span>
									<span class="white">登录入口</span>
								</h1>
							</div>

							<div class="space-6"></div>

							<div class="position-relative">
								<div id="login-box" class="login-box visible widget-box no-border">
									<div class="widget-body">
										<div class="widget-main">
											<h4 class="header blue lighter bigger">
												<i class="icon-coffee green"></i>
												请输入你的登录信息
											</h4>

											<div class="space-6"></div>

											<form>
												<fieldset>
													<label class="block clearfix">
														<span class="block input-icon input-icon-right">
															<input id="adminNameValue" type="text" class="form-control" placeholder="用户名" />
															<i class="icon-user green"></i>
														</span>
													</label>

													<label class="block clearfix">
														<span class="block input-icon input-icon-right">
															<input id="passwordValue" type="password" class="form-control" placeholder="密码" />
															<i class="icon-lock green"></i>
														</span>
													</label>
												
													<label class="block clearfix">
														<span class="block input-icon input-icon-right">
															<input id="cpathValue" type="text" class="form-control" placeholder="验证码" />
															<i class="icon-leaf green"></i>
														</span>
													</label>
													<label class="block clearfix">
														<img src="<?php echo site_url('admin/Login/code');?>" alt="" onclick= this.src="<?php echo site_url('admin/Login/code').'/'?>"+Math.random()  style="cursor: pointer;" title="看不清？点击更换另一个验证码。"/>
													</label>
													<div class="space"></div>

													<div class="clearfix">
<!-- 														<label class="inline">
															<input type="checkbox" class="ace" />
															<span class="lbl"> Remember Me</span>
														</label> -->

														<button type="button" class="width-100 pull-right btn btn-sm btn-primary" onclick="submitForm()">
															<i class="icon-key"></i>
															登录
														</button>
													</div>

													<div class="space-4"></div>
												</fieldset>
											</form>

										<!-- 	<div class="social-or-login center">
												<span class="bigger-110">使用微信登录（点击之后扫描二维码）</span>
											</div> -->

											<!-- <div class="social-login center">
												<a class="btn btn-primary">
													<i class="icon-facebook"></i>
												</a> -->

												<!-- <a class="btn btn-info">
													<i class="icon-twitter"></i>
												</a>

												<a class="btn btn-danger">
													<i class="icon-google-plus"></i>
												</a> -->
											<!-- </div> -->
										</div><!-- /widget-main -->

								<!-- 		<div class="toolbar clearfix">
											<div>
												<a href="#" onclick="show_box('forgot-box'); return false;" class="forgot-password-link">
													<i class="icon-arrow-left"></i>
													I forgot my password
												</a>
											</div>

											<div>
												<a href="#" onclick="show_box('signup-box'); return false;" class="user-signup-link">
													I want to register
													<i class="icon-arrow-right"></i>
												</a>
											</div>
										</div> -->
									</div><!-- /widget-body -->
								</div><!-- /login-box -->

								<div id="forgot-box" class="forgot-box widget-box no-border">
									<div class="widget-body">
										<div class="widget-main">
											<h4 class="header red lighter bigger">
												<i class="icon-key"></i>
												Retrieve Password
											</h4>

											<div class="space-6"></div>
											<p>
												Enter your email and to receive instructions
											</p>

											<form>
												<fieldset>
													<label class="block clearfix">
														<span class="block input-icon input-icon-right">
															<input type="email" class="form-control" placeholder="Email" />
															<i class="icon-envelope"></i>
														</span>
													</label>

													<div class="clearfix">
														<button type="button" class="width-35 pull-right btn btn-sm btn-danger">
															<i class="icon-lightbulb"></i>
															Send Me!
														</button>
													</div>
												</fieldset>
											</form>
										</div><!-- /widget-main -->

										<div class="toolbar center">
											<a href="#" onclick="show_box('login-box'); return false;" class="back-to-login-link">
												Back to login
												<i class="icon-arrow-right"></i>
											</a>
										</div>
									</div><!-- /widget-body -->
								</div><!-- /forgot-box -->

							</div><!-- /position-relative -->
						</div>
					</div><!-- /.col -->
				</div><!-- /.row -->
			</div>
		</div><!-- /.main-container -->

		<script type="text/javascript">

		function submitForm(){
			var adminNameValue=document.getElementById("adminNameValue").value;
			var passwordValue=document.getElementById("passwordValue").value;
			var cpathValue=document.getElementById("cpathValue").value;
			if(adminNameValue.length<=0){
				alert("用户名不能为空");
				return;
			}
			if(passwordValue.length<0){
				alert("密码不能为空");
				return;
			}
            
			
			$.ajax({
				url : '<?php echo site_url('admin/Login/login'); ?>',
				type : 'post',
				data : {
					adminNameValue:adminNameValue,
					passwordValue:passwordValue,
					cpathValue:cpathValue
				},
				
				success : function (data, response, status) {
					
					if(data==1){
						location.href = '<?php echo site_url('admin/DoctorMan/index'); ?>';
						//alert("登录成功");
					}else{
						alert(data);
					}

					
				}
			});
		}
</script>

<script type="text/javascript" src="<?php echo base_url('assets/js/jqueryHx.js')?>"></script>
</body>
</html>
